<meta charset="UTF-8">
  <div class="content-wrapper">
    <section class="content-header">
      <h1 style="text-align:center">
        	消费记录管理
      </h1>
    </section>
    <section class="content" style='position: relative;'> 
         <div class="panel-body" style="padding-bottom:0px;">
						<div class="row searchdiv">
							
							<!--<div class="form-group col-lg-2 col-xs-6 space">
								<div class="input-group date">
								  <input type="text" class="form-control pull-right" id="datepicker" ng-model='datepicker'>
								  <div class="input-group-addon">
									<i class="fa fa-calendar"></i>
								  </div>
								</div>
							</div>
							<div class="form-group col-lg-2 col-xs-6 space">
								<div class="input-group date">
								  <input type="text" class="form-control pull-right" id="datepicker2" ng-model='datepicker2'>
								  <div class="input-group-addon">
									<i class="fa fa-calendar"></i>
								  </div>
								</div>
							</div>-->
							<div class='col-md-3'>
							 	<input type="text" class="form-control pull-right" id="reservation" ng-model="searchDate" style='text-align: center;'>
							 </div>
							<div class="form-group col-lg-2 col-xs-6 space" style='width:90px;'>
                    <button type="submit" class="btn btn-default" style='padding: 6px 12px;' ng-click='search()'>
                    	<i class="fa fa-search"> 查询</i>
                    </button>
                </div>
                <div class="form-group col-lg-2 col-xs-6 space" style='display: inline-block;width: auto;vertical-align: middle;'>
									 <select class="form-control" ng-model="cardKind">
			                    <option>全部类型</option>
			                    <option>核减</option>
			                    <option>核加</option>
			                    <option>食堂消费</option>
			            </select>
								</div>
							
								<div class="form-group col-lg-2 col-xs-6 space" style='display: inline-block;width: 160px;vertical-align: middle;'>
									<input class="form-control" type="text" placeholder="请输入饭卡号/姓名" ng-model="cardInfor">
								</div>
								<button style='margin-right: 3%;' class="btn pull-right" ng-click="download('consumeTableExport','消费记录信息')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>
			      </div>
			   </div>
			   
			   
			   <!--<div class="panel-body" style="padding-bottom:0px;margin-top: -15px;">
						<div class="row searchdiv">
							<div class="form-group col-lg-2 col-xs-6 space" style='display: inline-block;width: auto;vertical-align: middle;'>
									 <select class="form-control" ng-model="cardKind">
			                    <option>全部类型</option>
			                    <option>核减</option>
			                    <option>核加</option>
			                    <option>食堂消费</option>
			            </select>
								</div>
							
								<div class="form-group col-lg-2 col-xs-6 space" style='display: inline-block;width: 160px;vertical-align: middle;'>
									<input class="form-control" type="text" placeholder="请输入饭卡号/姓名" ng-model="cardInfor">
								</div>
			      </div>
			   </div>-->
			   
			   
			<!--表格-->
			<div class="box" >
            <div class="box-body">
              <div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap"><div class="row"><div class="col-sm-6"></div><div class="col-sm-6"></div></div><div class="row"><div class="col-sm-12">
              	<table id='consumeTable' style='width: 100%; position: relative;overflow: auto;height:500px; display: block;background: #ffffff;' class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
	                <thead style='display: inline-table;width: 100%;'>
		                <tr role="row">
		                	<th    style="width: 12%;">卡号</th>
		                	<th  style="width: 8%;">姓名</th>
		                	<th   style="width: 10%;">消费类型</th>
		                	<th  style="width: 12%;">消费时间</th>
		                	<th   style="width: 12%;">消费总金额</th>
		                	<th   style="width: 9%;">消费餐补</th>
		                	<th  style="width: 9%;">消费充值金额</th>
		                	<th   style="width: 9%;">修改标记</th>
		                	<th  style="width: 9%;">操作</th>
		                </tr>
	                </thead>
	              <tbody style='display: inline-table;width: 100%;'>
			                <tr style='position: relative;width: 100%;display: inline-table;' ng-class="{even:!$even, odd:!$odd}" ng-repeat="consume in items">
				                  <td class="sorting_1" style='display: none;'>{{consume.expenseRecordId}}</td>
				                  <td style="width: 12%;">{{consume.cardNo}}</td>
				                  <td style="width: 8%;" >{{consume.username}}</td>
				                  <td style="width: 10%;">{{consume.expenseType}}</td>
				                  <td style="width: 12%;">{{consume.expenseTime}}</td>
				                  <td style="width: 12%;">{{consume.expenseTotalMoney}}</td>
								  				<td style="width: 9%;" >{{consume.expenseSubsidy}}</td>
								  				<td style="width: 9%;" >{{consume.expenseRecharge}}</td>
								  				<td style="width: 9%;" >{{consume.alterFlag=='0'?'已修改':'未修改'}}</td>
								  				<td style="width: 9%;" >
				                  	<a href=""  class="btn btn-lg edit" style="padding:0px" title="修改" ng-click="edit(consume.expenseRecordId,consume.cardNo,consume.username,consume.expenseType,consume.expenseTime,consume.expenseTotalMoney,consume.expenseSubsidy,consume.expenseRecharge)"><i class="fa fa-edit"></i></a>
				                  	<a href=""  class="btn btn-lg del" style="padding:0px" title="删除" ng-click="del(consume.expenseRecordId,consume.cardNo,consume.username,consume.expenseTime)"><i class="fa  fa-close"></i></a>
				                  </td>
			                </tr>
	                </tbody>
              </table>
              <table id='consumeTableExport' style='z-index:-100;width: 100%; position: fixed;overflow: scroll;height:450px; display: block;background: #ffffff;' 
              	 class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
	                <thead style='display: inline-table;width: 100%;'>
		                <tr role="row">
		                	<th    style="width: 10%;">姓名</th>
		                	<th  style="width: 12%;">卡号</th>
		                	<th   style="width: 15%;">手机号</th>
		                	<th  style="width: 12%;">余额</th>
		                	<th   style="width: 15%;">最近一次操作时间</th>
		                </tr>
	                </thead>
	              <tbody style='display: inline-table;width: 100%;'>
			                <tr style='position: relative;width: 100%;display: inline-table;' ng-class="{even:!$even, odd:!$odd}" ng-repeat="consume in data">
				                  <td class="sorting_1" style='display: none;'>{{consume.expenseRecordId}}</td>
				                  <td style="width: 12%;">{{consume.cardNo}}</td>
				                  <td style="width: 8%;" >{{consume.username}}</td>
				                  <td style="width: 10%;">{{consume.expenseType}}</td>
				                  <td style="width: 12%;">{{consume.expenseTime}}</td>
				                  <td style="width: 12%;">{{consume.expenseTotalMoney}}</td>
								  				<td style="width: 9%;" >{{consume.expenseSubsidy}}</td>
								  				<td style="width: 9%;" >{{consume.expenseRecharge}}</td>
								  				<td style="width: 9%;" >{{consume.alterFlag=='0'?'已修改':'未修改'}}</td>
								  				<td style="width: 9%;" >
				                  	<a href=""  class="btn btn-lg edit" style="padding:0px" title="修改" ng-click="edit(consume.expenseRecordId,consume.cardNo,consume.username,consume.expenseType,consume.expenseTime,consume.expenseTotalMoney,consume.expenseSubsidy,consume.expenseRecharge)"><i class="fa fa-edit"></i></a>
				                  	<a href=""  class="btn btn-lg del" style="padding:0px" title="删除" ng-click="del(consume.expenseRecordId,consume.cardNo,consume.username,consume.expenseTime)"><i class="fa  fa-close"></i></a>
				                  </td>
			                </tr> 
	                </tbody>
	                <tfoot>
	                </tfoot>
              </table>
              
              
              </div>
              </div>
              <div class="row" style="margin-bottom:10px;">
              	<div class="col-sm-3">
              		<div class="dataTables_info" id="example1_info" role="status" aria-live="polite">总条目数：{{totalNums}}</div>
              	</div>
                <div class="col-sm-9">
                	<div class="dataTables_paginate paging_simple_numbers row" id="example1_paginate">
                		<label style="font-weight:normal;float:left;padding-right:15px;">每页显示数目 
                			<select name="example1_length" aria-controls="example1" class="form-control input-sm" ng-change="change(initial)" ng-model="initial" > 
                				<option value="10">10</option> 
                				<option value="25">25</option>
                				<option value="50">50</option>
                				<option value="100">100</option>
                			</select>
                		</label>
                		<ul class="pagination col-lg-7" style='cursor: pointer;'>
                			<li class="paginate_button previous " id="example1_previous" >
                				<a  ng-click="Previous()">上一页</a>
                			</li>
                			<li   ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}"><!-- class=" paginate_button active" -->
                				<a  ng-click="selectPage(page)">{{page}}</a>
                			</li>
                			<li class="paginate_button next" id="example1_next">
                				<a  ng-click="Next()">下一页</a>
                			</li>
                		</ul>
                	</div>
                </div>
              </div>
              </div>
            </div>
      </div>
	</section>
</div>

<!-- 消费记录修改modal -->
<div class="modal fade" id="editConsume" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">修改</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body" >
        	<form class="form-horizontal">
                <div class="box-body">
                    
                    <div class="form-group">
                        <label class="col-sm-2 control-label" >卡号</label> 
                        <div class="col-sm-10">
                            <input type="text" class="form-control"  readonly ng-model="cardNo">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" >姓名</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" readonly ng-model="userName">
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label" >消费类型</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" readonly ng-model="expenseType">
                        </div>
                    </div> 
                     <div class="form-group">
                        <label class="col-sm-2 control-label" >消费时间</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" readonly ng-model="expenseTime">
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label" style='padding-left: 0px;' >消费总金额</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" ng-model="expenseTotalMoney">
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label" >消费餐补</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control"  ng-model="expenseSubsidy">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" >充值金额</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control"  ng-model="expenseRecharge">
                        </div>
                    </div>
                   
                </div> 
                </form>
	    </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-success btn-lg" ng-click="editConsume()">确定</button>
      </div>
    </div>
  </div> 
</div> 
<!-- 撤销消费记录modal  -->
  <div class="modal fade" id="cancelConsume" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">提示</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body">
           	确定撤销卡号：{{cardNo}}，姓名：{{userName}}，时间：{{expenseTime}}的消费记录吗？
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-success btn-lg" ng-click=del_emp();>确定</button>
      </div>
    </div>
  </div>
</div>

<style>
	.space{
		padding-left:2px;
		padding-right:2px;
	}
	.box{
		border-top:1px solid #d2d6de;
	}
	.pagination{
		margin:0;
	}
	.odd{background-color: #f9f9f9 !important;}
	.even{background-color: transparent !important;}
	.btn{    padding: 10px 12px;}
</style>
<script>
					$(document).ready(function() {
							
//							$('#table_example').hide();
  							//$('#example').dataTable();
					} );
					
				
	
</script>